package com.wsl.Condition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 12:07 2017/11/26
 * @Modified by:
 */
public class LinuxCondition implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        return conditionContext.getEnvironment()
                .getProperty("os.name").contains("Linux");
    }
}
